<?php

class DbConfig {

    //主库中的表
    static protected $db_main = array();
    //用户库中的表
    static protected $db_user = array();

    /**
     * 主库配置
     * @return \DbYspMysqlPdo
     */
    static protected function DbConnMain() {
        $db_config = array(
            'host' => '127.0.0.1',
            'port' => 3306,
            'user' => 'root',
            'pwd' => 'root',
            'dbname' => 'xiaoxia'
        );

        //用户表
        self::$db_main['users'] = 'tb_users';
        //问题表
        self::$db_main['questions'] = 'tb_questions';
        //答案表
        self::$db_main['answers'] = 'tb_answers';

        return new DbYspMysqlPdo($db_config);
    }
    
    /**
     * 用户库
     */
    static protected function DbConnUser() {
        $db_config = array(
            'host' => '127.0.0.1',
            'port' => 3306,
            'user' => 'test',
            'pwd' => '123456',
            'dbname' => 'dUsersDB'
        );
        
        self::$db_main['users'] = 'tb_users';
        
        return new DbYspMysqlPdo($db_config);

    }

    static protected $question_type = array(
        0 => '综合题',
        1 => 'HTML',
        2 => 'CSS',
        3 => 'Javascript',
        4 => 'Jquery',
        5 => 'PHP',
        6 => '数据库',
        7 => 'Linux命令',
        8 => 'VIM编辑器',
        9 => '其它'
    );

}
